<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<script type="text/javascript">
    $(function() {
    	$("#currParentid").val(parent.getParentId());
        $('#catalogEditForm').form({
            url : '${path }/catalog/save',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                 	parent.$.messager.show({title: '提示！',msg:result.msg});
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#catalogEditForm');
                    parent.$.messager.alert('提示', eval(result.msg), 'warning');
                }
            }
        });
        
    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div  data-options="region:'center',border:false" title="" style="padding: 3px;">
	<form id="catalogEditForm" method="post">
		<input type="hidden" name="id" value="${catalog.id}"/>
		<input type="hidden" name="cataloglevel" value="${catalog.catalogLevel}"/>
		<input type="hidden" name="parentId" id="currParentid" value="${catalog.parentId}"/>
		<input type="hidden" name="oldId" id="oldId" value="${catalog.id}"/>
		<input type="hidden" name="oldCode" id="oldCode" value="${catalog.catalogCode}"/>
		<table class="grid">
            <tr>
				<td>栏目名称:</td>
				<td colspan="2"><input type="text" id="catalogName" name="catalogName"
					class="easyui-textbox" required="true" data-options="validType:'length[1,100]'"value="${catalog.catalogName}">
				</td>
			</tr>
			 <tr>
				<td>
					栏目类型:
				</td>
				<td>
				    <select class="easyui-combobox" name="catalogType" style="width:200px;">
				    <c:forEach var="dList" items="${dictList}">
				   	 	<option value="${dList.dictcode}">${dList.dictname}</option>
					</c:forEach>
				        
				    </select>
				</td>
			 </tr>
		 	<tr>
				<td>
					栏目编码:
				</td>
				<td><input type="text" id="catalogCode" name="catalogCode" data-options="validType:'length[0,100]'"
					class="easyui-textbox"  value="${catalog.catalogCode}">
				</td>
		 </tr>
		 <tr>
			<td>
				图片URL:
			</td>
			<td>
				<input type="text" id="imgurl" name="imgurl"  data-options="validType:'length[0,120]'"
				class="easyui-textbox"   value="${catalog.imgurl}">
			</td>
		 </tr>
		 <tr>
		 	<td>
				描述:
			</td>
			<td><textarea rows="3" cols="3" style="width: 100%;" id="remark" name="remark"> ${catalog.remark}</textarea></td>
		 </tr>
		 <tr>
			<td>
				显示序号:
			</td>
			<td><input name="sequence" class="easyui-numberbox" min="0" max="99"
				required="true"  value="${catalog.sequence}">
			</td>
		 </tr>
		 <tr>
			<td>
				有效标志:
			</td>
			<td><input type="radio" name="status" id="status1" value="1"
				style="bottom: 0px; height: 16px" <c:choose> <c:when test="${catalog.status== '1'}"> checked="checked" </c:when></c:choose> />
				有效
			
			<input type="radio" name="status" id="status0" value="0"
				style="bottom: 0px; height: 16px" <c:choose> <c:when test="${catalog.status== '0'}"> checked="checked"</c:when></c:choose>/>
				无效
			</td>
		</table>
	</form>
		<br>
	</div>
</div>